package sg.edu.nus.iss.vmcs.ui;

import java.util.Observable;
import java.util.Observer;

import javax.swing.JLabel;
import javax.swing.JPanel;

public class MoneyInsertedPanel extends Observable {
	private JLabel monInsertedLabel;
	private ObserverLabel monInserted;
	private static double totalCoinsInserted;
	
	private JPanel moneyPanel = new JPanel();
	
	public MoneyInsertedPanel (double totalCoinsInserted) {
		monInsertedLabel = new JLabel("Total Money Inserted");
		monInserted = new ObserverLabel(totalCoinsInserted + " c");
		
		moneyPanel.add(monInsertedLabel);
		moneyPanel.add(monInserted);
		
		addObserver(monInserted);
	}

	public JPanel getMoneyPanel() {
		return moneyPanel;
	}

	public double getTotalCoinsInserted() {
		return totalCoinsInserted;
	}

	public void setTotalCoinsInserted(double totalCoinsInserted) {
		this.totalCoinsInserted = totalCoinsInserted;
		setChanged();
	}
	
	
}
